//
//  AirplaneDetailViewModel.swift
//  ImGuider X
//
//  Created by 陆涛 on 2018/10/10.
//  Copyright © 2018 imguider. All rights reserved.
//

import UIKit

class AirplaneDetailViewModel: NSObject {
    
    var calender: Calendar? {
        
        didSet {
            
            var datasource:[[String:Any]] = []
            
            if let departureAirport = calender?.airplaneDetail?.departureAirportObj{
                
                datasource.append(["air":departureAirport])
            }
            
            for transfer in calender?.airplaneDetail?.transfer ?? [] {
                
                datasource.append(["air":transfer])
            }
            
            if let destinationAirport = calender?.airplaneDetail?.arrivalAirportObj{
                
                datasource.append(["air":destinationAirport])
            }
            
            self.dataSource = datasource
        }
        
    }
    
    var dataSource:[[String:Any]]?
}


